using System;
using OverStore.Runtime.Storage;

namespace OverStore.TutorialAsTest.UnitTest
{
    public static class RecordExt
    {
        public static object GetValue(this IRecord record, string name)
        {
            if (record == null)
                throw new ArgumentNullException("record");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");
            object result;
            return record.TryGetValue(name, out result) ? result : null;
        }
    }
}